# -*- coding: utf-8 -*-


import arcpy
path = r"e:\现状图.mdb"
arcpy.env.workspace = path
Dataset = arcpy.ListDatasets()
FeatureClass = arcpy.ListFeatureClasses()
for each in FeatureClass:
    print ("正在处理%s".decode("utf-8")%each)
    try:
        arcpy.DefineProjection_management(each,2365)
    except:
        print ("ERROR--------处理%s失败".decode("utf-8") % each)
for each in Dataset:
    print ("正在处理%s".decode("utf-8") % each)
    try:
        arcpy.DefineProjection_management(each, 2365)
    except:
        print ("ERROR--------处理%s失败".decode("utf-8") % each)
# for each_Dataset in Dataset:
#     print ("处理数据集%s".decode("utf-8")%each_Dataset)
#     arcpy.env.workspace = path+"\\"+each_Dataset.encode("utf-8")
#     FeatureClass = arcpy.ListFeatureClasses()
#     for each in FeatureClass:
#         print ("正在处理%s".decode("utf-8") % each)
#         try:
#             arcpy.DefineProjection_management(each, 2365)
#         except:
#             print ("ERROR--------处理%s失败".decode("utf-8") % each)
